﻿' Copyright (c) 2013  DotNetNuke Corporation
'  All rights reserved.
' 
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
' DEALINGS IN THE SOFTWARE.
' 

Imports DotNetNuke

Namespace Data

    ''' <summary>
    ''' An abstract class for the data access layer
    ''' 
    ''' The abstract data provider provides the methods that a control data provider (sqldataprovider)
    ''' must implement. You'll find two commented out examples in the Abstract methods region below.
    ''' </summary>

    Public MustInherit Class DataProvider

#Region "Shared/Static Methods"

        ' singleton reference to the instantiated object 
        Private Shared objProvider As DataProvider = Nothing

        ' constructor
        Shared Sub New()
            CreateProvider()
        End Sub

        ' dynamically create provider
        Private Shared Sub CreateProvider()
            objProvider = CType(Framework.Reflection.CreateObject("data", "DotNetNuke.Modules.AccordionTabs.Data", ""), DataProvider)
        End Sub

        ' return the provider
        Public Shared Shadows Function Instance() As DataProvider
            Return objProvider
        End Function

#End Region

#Region "Abstract methods"
        'public MustOverride function GetItems(ByVal moduleId as Integer) as IDataReader 
        'public MustOverride function GetItem(ByVal itemid as Integer) as IDataReader

        Public MustOverride Function GetTabs(ByVal ModuleID As Integer) As IDataReader
        Public MustOverride Function GetTabsReverse(ByVal ModuleID As Integer) As IDataReader

        Public MustOverride Function GetSingleTab(ByVal ModuleID As Integer, ByVal ItemID As Integer) As IDataReader
        Public MustOverride Sub ModifyTab(ByVal ModuleID As Integer, ByVal ItemID As Integer, ByVal TitleOfTab As String, _
                                                 ByVal ContentsOfTab As String, ByVal IsVisible As Boolean, ByVal SortOder As Integer)
        Public MustOverride Sub ModifyTabSortOrder(ByVal ModuleID As Integer, ByVal ItemID As Integer, ByVal SortOrder As Integer)
        Public MustOverride Sub InsertTab(ByVal ModuleID As Integer, ByVal TitleOfTab As String, ByVal ContentsOfTab As String, _
                                                 ByVal IsVisible As Boolean, ByVal SortOrder As Integer)
        Public MustOverride Sub DeleteTab(ByVal ModuleID As Integer, ByVal ItemID As Integer)
        Public MustOverride Sub DeleteAllTabs(ByVal ModuleID As Integer)

        '
        'Display Styles Database Functions
        '

        Public MustOverride Function GetDisplayStyles(ByVal ModuleID As Integer) As IDataReader
        Public MustOverride Function GetDisplayStyle(ByVal ModuleID As Integer, ByVal DisplayStyleID As Integer) As IDataReader

        Public MustOverride Sub AddDisplayStyle(ByVal ModuleID As Integer, ByVal DisplayStyle As String, _
                                                ByVal DisplayStyleNotes As String)
        Public MustOverride Sub ModifyDisplayStyle(ByVal ModuleID As Integer, ByVal DisplayStyleID As String, _
                                                   ByVal DisplayStyle As Integer, ByVal DisplayStyleNotes As String)
        Public MustOverride Sub DeleteDisplayStyle(ByVal ModuleID As Integer, ByVal DisplayStyleID As Integer)
        Public MustOverride Sub DeleteAllDisplayStyles(ByVal ModuleID As Integer)


#End Region

    End Class

End Namespace